package com.fuled.test.tool_config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author hcy
 * 启用请求头拦截器
 */
@Component
public class WebConfigPerformanceTool implements WebMvcConfigurer {

    @Autowired
    private HeaderInterceptorPerformanceTool HeaderInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(HeaderInterceptor)
                .addPathPatterns("/**");
    }
}